package router

import (
	"jgt-oper/src/web"

	"github.com/facebookgo/inject"
	"github.com/teambition/gear"
	"jgt-oper/src/context"
)

// WebNoticeMap 注册路由映射
func WebNoticeMap(g *inject.Graph, r *gear.Router) {
	a := new(web.NoticeController)
	err := g.Provide(&inject.Object{Value: a})
	if err != nil {
		panic(err)
	}

	r.Get("/notice/page", context.WrapContext(a.QueryPage))
	r.Get("/notice/detail/:id", context.WrapContext(a.Get))
	r.Post("/notice/create", context.WrapContext(a.Create))
	r.Put("/notice/update", context.WrapContext(a.Update))
	r.Delete("/notice/delete/:id", context.WrapContext(a.Delete))
}
